package GUI;

import java.awt.Color;

import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JLabel;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * The Class SaleResponsesReportGUI.
 * Boundary for sale responses report producing activity
 */
public class SaleResponsesReportGUI extends AbstractPanelGUI {
	
	/** The button back. */
	private JButton btnBack;
	
	/** The list. */
	private JList<String> list;

	/**
	 * Create the panel.
	 */
	public SaleResponsesReportGUI() {
		
		initialize();
	}

	/* (non-Javadoc)
	 * @see GUI.AbstractPanelGUI#initialize()
	 */
	@Override
	public void initialize() {
		setBackground(Color.ORANGE);
		setLayout(null);
		setSize(Width,Height);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(86, 45, 291, 195);
		add(scrollPane);
		
		list = new JList<String>();
		scrollPane.setViewportView(list);
		
		JLabel lblSaleResponsesReport = new JLabel("Sale responses report:");
		lblSaleResponsesReport.setFont(new Font("Tahoma", Font.BOLD, 15));
		lblSaleResponsesReport.setBounds(140, 11, 187, 26);
		add(lblSaleResponsesReport);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(10, 266, 89, 23);
		add(btnBack);
		
	}

	/**
	 * Gets the button back.
	 *
	 * @return the button back
	 */
	public JButton getBtnBack() {
		return btnBack;
	}

	/**
	 * Sets the button back.
	 *
	 * @param btnBack the new button back
	 */
	public void setBtnBack(JButton btnBack) {
		this.btnBack = btnBack;
	}

	/**
	 * Gets the list.
	 *
	 * @return the list
	 */
	public JList<String> getList() {
		return list;
	}

	/**
	 * Sets the list.
	 *
	 * @param list the new list
	 */
	public void setList(JList<String> list) {
		this.list = list;
	}
	
	/**
	 * Adds action listener to back button.
	 *
	 * @param listener the listener
	 */
	public void addBackListener(ActionListener listener)
	{
		btnBack.addActionListener(listener);
	}
}
